<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

class Front_Controller extends CI_Controller {

    public $_config;
    public $_viewFront;
    public $_staticPathPublic;
    
    public function __construct() {
        parent::__construct();

        //get config
        $this->_config = $this->config->config;
        $this->_viewFront = $this->_config['front_path'];
        $this->_staticPathPublic = $this->_config['front_public'];
        // Init data
        $data = array();
        // Load library template
        $this->load->library('template');
        // Set template
        $this->template->set_template('default');

        // Parse data into view
        $this->template->parse_view('header', $this->_config['front_themes'] . 'header', $data);
        $this->template->parse_view('sidebar', $this->_config['front_themes'] . 'sidebar', $data);
        $this->template->parse_view('footer', $this->_config['front_themes'] . 'footer', $data);

        //Add js into template
        $this->template->add_js($this->_staticPathPublic . 'js/jquery.js');

        //Add css into template
        $this->template->add_css($this->_staticPathPublic . 'css/main.css');
    }
}

?>